home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 September
/
PCWorld_2006-09_cd.bin
/
v cisle
/
hexer
/
mpth_17.exe
/
{app}
/
scripts
/
Structure Viewer
/
fat16.mps
< prev
next >
Wrap
Text File
|
2006-03-19
|
4KB
|
144 lines
option title, "FAT16 Boot structure"
=
=
= Tiny Hexer script for FAT16 structure view in
= mirkes.de's tiny hex editor
=
= I borrowed heavily from the built-in .BMP viewer
=
= 02-07-05 Bill Blankenship
=
option GlobalVars, 1
option ReadTags, 1
option target, structureviewer
= open active editor and goto current position/0
var editor file
editor = fileopen('::current')
if ((param_count > 0) and (dword(params(0))==1))
fileseek editor, 0
else
fileseek editor, filegetprop(editor, 'selstart')
endif
var start dword
start = filegetprop(editor, 'position')
= open browser window
var browser file
browser = fileopen('::browser', 'c')
filesetprop browser, 'accepttags', 1
filewrite browser "<font color=",'"',"blue",'"',"><b><u>FAT16 Boot structure:</u></b></font>\n\n"
filesetprop browser, 'accepttags', 0
filewrite browser "Position: ",start,"\n\n"
= read the JMP instruction
var JMP1 byte JMP2 byte NOP byte
fileread editor JMP1
fileread editor JMP2
fileread editor NOP
= print JMP Instruction
filewrite browser "JMP instruction: \t\t'",JMP1," ",JMP2," ",NOP,"'\n"
var OEM text
fileread editor OEM 8
filewrite browser "OEM: \t\t\t\t'",OEM,"'\n"
= Do BIOS Parameter block
var bytespersect word sectpercluster byte reservedsect word numfats byte
var rootentries word smallsectors word mediatype byte sectperfat word
var sectpertrack word numheads word hiddensect dword largesectors dword
var disknum byte curhead byte signature byte volumesn dword volumelabel text sysid text
fileread editor bytespersect
filewrite browser "Bytes per Sector: \t\t'",bytespersect,"' ("
call TO_DEC @bytespersect
filewrite browser " dec)\n"
fileread editor sectpercluster
filewrite browser "Sectors per cluster: \t\t'",sectpercluster,"' ("
call TO_DEC @sectpercluster
filewrite browser " dec)\n"
fileread editor reservedsect
filewrite browser "Reserved Sectors: \t\t'",reservedsect,"' ("
call TO_DEC @reservedsect
filewrite browser " dec)\n"
fileread editor numfats
filewrite browser "Number of FATs: \t\t'",numfats,"'\n"
fileread editor rootentries
filewrite browser "Max root entries: \t\t'",rootentries,"' ("
call TO_DEC @rootentries
filewrite browser " dec)\n"
fileread editor smallsectors
filewrite browser "Small sectors: \t\t'",smallsectors,"' ("
call TO_DEC @smallsectors
filewrite browser " dec)\n"
fileread editor mediatype
filewrite browser "Media type: \t\t\t'",mediatype,"'\n"
fileread editor sectperfat
filewrite browser "Sectors per FAT: \t\t'",sectperfat,"' ("
call TO_DEC @sectperfat
filewrite browser " dec)\n"
fileread editor sectpertrack
filewrite browser "Sectors per track: \t\t'",sectpertrack,"' ("
call TO_DEC @sectpertrack
filewrite browser " dec)\n"
fileread editor numheads
filewrite browser "Number of heads: \t\t'",numheads,"' ("
call TO_DEC @numheads
filewrite browser " dec)\n"
fileread editor hiddensect
filewrite browser "Hidden sectors: \t\t'",hiddensect,"' ("
call TO_DEC @hiddensect
filewrite browser " dec)\n"
fileread editor largesectors
filewrite browser "Large sectors: \t\t'",largesectors,"' ("
call TO_DEC @largesectors
filewrite browser " dec)\n"
fileread editor disknum
filewrite browser "Disk number: \t\t\t'",disknum,"'\n"
fileread editor curhead
filewrite browser "Current head (not used): \t'",curhead,"'\n"
fileread editor signature
filewrite browser "NT signature: \t\t\t'",signature,"' ("
call TO_DEC @signature
filewrite browser " dec)\n"
fileread editor volumesn
filewrite browser "Volume serial number: \t\t'",volumesn,"' ("
call TO_DEC @volumesn
filewrite browser " dec)\n"
fileread editor volumelabel 11
filewrite browser "Volume label: \t\t\t'",volumelabel,"'\n"
fileread editor sysid 8
filewrite browser "System ID: \t\t\t'",sysid,"'\n"
end
= decimal output - taken from BMP viewer
@@TO_DEC
number_radix = 10
number_prefix = ''
var _r1 varref
pop _r1
filewrite browser deref(_r1)
number_prefix = '0x'
number_radix = 16
return